program drop _all
program define ARDLprog, rclass
version 14
syntax, beta0(real) betay(real) betax(real) smallobs(integer) bigobs(integer)
// Remove existing variables
drop _all

// Create the data
set obs `bigobs' 
gen t = _n
tsset t
// We initialize y as its LR equilibrium value
gen x=rnormal()
gen u=rnormal()
gen y = `beta0'/(1-`betay')
replace y = `beta0' + `betax'*x+`betay'*L.y + u in 2/l
regress y L.y x in -`smallobs'/l
return scalar LRP = _b[x]/(1-_b[L.y])
testnl _b[x]/(1-_b[L.y])=`betax'/(1-`betay')
return scalar pLRP = r(p)

end
